package com.anworld.controller;

import com.anworld.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/")
public class TestController {

    //自动注入Feign接口对象
    @Autowired
    TestService service;

    @GetMapping("/get")
    @ResponseBody
    public String get() {
        //像调用方法一样调用即可实现服务生产者端的调用
        String name = service.getName("123");
        return name;
    }
}
